#pragma once

#include <iostream>
#include <list>
#include <ostream>
#include <queue>
#include <string>
#include <unordered_map>
#include <unordered_set>

#include "arithmetic.h"
#include "domtree.h"
#include "ir.h"
#include "irblock.h"
#include "irfunction.h"
#include "iroperand.h"
#include "pass.h"
#include "utils.h"

class SSABuilder : public Pass {
    DomTree T;

    void Internalize(IRFunction* func);

    void InsertPhi(IRFunction* func);

    void RenameVar(IRFunction* func);

    void Build(IRFunction* func);

  public:
    void* Run(void* input) override;
};
